package com.heima.model.common.enums;

public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(200,"操作成功"),
    // 登录段 10001~10050
    NEED_LOGIN(10001,"需要登录后操作"),
    LOGIN_PARAM_ERROR(10002,"用户名或密码错误"),
    ACCOUNT_DISABLED(10003,"账户被禁用"),
    // TOKEN 10050~100100
    TOKEN_INVALID(10050,"无效的TOKEN"),
    TOKEN_EXPIRE(10051,"TOKEN已过期"),
    TOKEN_REQUIRE(10052,"TOKEN是必须的"),
    //参数错误 10500~101000
    PARAM_REQUIRE(10500,"缺少参数"),
    PARAM_INVALID(10501,"无效参数"),
    PARAM_SPECIFICATION(10502,"参数不符合规范"),
    PARAM_IMAGE_FORMAT_ERROR(10503,"图片格式有误"),

    // 数据错误 11000~12000
    DATA_EXIST(11000,"数据已经存在"),
    DATA_NOT_EXIST(11001,"数据不存在"),
    DATA_IS_REFERENCED(11002,"数据被引用"),
    DATA_IS_ENABLE(11003,"数据正在使用中"),

    // 数据错误 13000~13500
    NO_OPERATOR_AUTH(13000,"无权限操作"),
    NEED_ADMIND(13001,"需要管理员权限"),
    SERVER_ERROR(13002, "服务器异常");

    private int code;
    private String message;

    AppHttpCodeEnum(int code, String message){
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return message;
    }
}
